<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function $(id){
            return document.getElementById(id);
        }
        window.onload = function (){
            $("b1").onclick = function (){
                click2();
            }
        }

        function buttonClick(){
            alert("buttonClick");
        }

        function click2(){
            alert("click2");
        }
        function canelEvent(){
            $("b1").onclick = null;
            $("bc").onclick = null;
        }
    </script>
</head>
<body>
    <input type="button" value="按钮1" id="bc" onclick="buttonClick()">
    <input type="button" value="按钮2" id="b1">
    <input type="button" value="取消事件" onclick="canelEvent()">
</body>
</html>